package com.cjjd.c;

import android.app.Application;
import android.content.Context;
import android.os.Handler;

import com.cjjd.c.utils.ImageUtil;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import com.uuzuche.lib_zxing.activity.ZXingLibrary;


/**
 * Created by Administrator on 2016/3/14 0014.
 */
public class App extends Application {

    private static Context context;
    private static Handler mHandler;

    public static final String APP_ID = "wxe9ebca693d8358ea";
    public static final String AppSecret = "182ee5b2e474a6a140b46b77c52f954e";
//    public static final String AppSecret = "c41c613c19d251005f5bcca841afcb9b";
    public static IWXAPI WX_API;
    @Override
    public void onCreate() {
        super.onCreate();

        context = this;

        ImageUtil.init(context);

        // 获取 IWXAPI 的实例
        WX_API = WXAPIFactory.createWXAPI(this,APP_ID,false);
        // 将应用的 appid 注册到微信
        WX_API.registerApp(APP_ID);

        ZXingLibrary.initDisplayOpinion(this);

    }

    public static Handler getMainHandler() {
        if (mHandler == null) {
            mHandler = new Handler();

        }
        return mHandler;

    }

    public static Context getContext() {
        return context;
    }
}

